import type { CrudFilters } from "@refinedev/core"
import { useSetState } from "ahooks"

export const useParams = <S = any>(initialState: S | (() => S)) => {
    const [params, setParams] = useSetState<S>(initialState)
    const [searchParams, setSearchParams] = useSetState<S>(initialState)
    const search = () => {
        setParams(searchParams)
    }
    return {
        params,
        search,
        setParams: setSearchParams,
        onChange: (e: any) => setParams(e),
        searchParams
    }
}
export const createFilters = (): CrudFilters => {
    return []
}